home *** CD-ROM | disk | FTP | other *** search
- //-------------------------------------------------------------------//
-
- // Synopsis: An upper quasi-triangular matrix.
-
- // Syntax: A = rschur ( N, MU, X, Y )
-
- // Descriptioin:
-
- // A is an N-by-N matrix in real Schur form. All the diagonal
- // blocks are 2-by-2 (except for the last one, if N is odd) and
- // the k'th has the form [x(k) y(k); -y(k) x(k)]. Thus the
- // eigenvalues of A are x(k) +/- i*y(k). MU (default 1) controls
- // the departure from normality.
-
- // Defaults: X(k) = -k^2/10, Y(k) = -k, i.e., the eigenvalues
- // lie on the parabola x = -y^2/10.
-
- // References:
- // F. Chatelin, Eigenvalues of Matrices, John Wiley, Chichester, 1993;
- // Section 4.2.7.
- // F. Chatelin and V. Fraysse, Qualitative computing: Elements
- // of a theory for finite precision computation, Lecture notes,
- // CERFACS, Toulouse, France and THOMSON-CSF, Orsay, France,
- // June 1993.
-
- // This file is a translation of rschur.m from version 2.0 of
- // "The Test Matrix Toolbox for Matlab", described in Numerical
- // Analysis Report No. 237, December 1993, by N. J. Higham.
-
- //-------------------------------------------------------------------//
-
-
- rschur = function ( n , mu , x , y )
- {
- local ( n , mu , x , y )
-
- m = floor(n/2)+1;
- alpha = 10;
- beta = 1;
-
- if (!exist (y)) { y = -(1:m)/beta; }
- if (!exist (x)) { x = -(1:m).^2/alpha; }
- if (!exist (mu)) { mu = 1; }
-
- A = diag( mu*ones(n-1,1), 1 );
- for (i in 1:2*(m-1):2)
- {
- j = (i+1)/2;
- A[i:i+1;i:i+1] = [x[j], y[j]; -y[j], x[j]];
- }
-
- if (2*m != n)
- {
- A[n;n] = x[m];
- }
-
- return A;
- };
-